<?php

namespace app\common\validate;

use think\Validate;

class Resource extends Validate
{
    /**
     * 验证规则
     */
    protected $rule = [
        'id'=>'require',
        'user_type'=>'require',
        'category_id'=>'require',
        'name'=>'require',
        'intro'=>'require',
        'icon'=>'require',
        'images'=>'require',
        //'tag_ids'=>'require',
        'shouyou_ids'=>'require',
        'type'=>'require',
        //'file'=>'require',
        //'size'=>'require',
        //'publish_time'=>'datetime',
    ];
    /**
     * 提示消息
     */
    protected $message = [
    ];
    /**
     * 验证场景
     */
    protected $scene = [
        'add'  => ['name','intro','icon','images','category_id','user_type','tag_ids','shouyou_ids','type','file','size','publish_time','hots'],
        'edit' => ['id','name','intro','icon','images','category_id','user_type','tag_ids','shouyou_ids','type','file','size','publish_time','hots'],
    ];
    
}
